Skip to content

[FEATURE] Declare the restart parameters on extract() and document what a restart costs - #672

Merged
noel-improv merged 4 commits into
awslabs:mainfrom
noel-improv:docs/restart-api-timings
Nov 10, 2026
Merged

noel-improv merged 4 commits into
awslabs:mainfrom
noel-improv:docs/restart-api-timings

Conversation

@noel-improv

@noel-improv noel-improv commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

extract() and extract_and_build() accepted run_id and run_plan_store only through **kwargs, so a restartable run was missing from their signatures, their docstrings and help(). This declares both as named parameters and documents what a restart costs, using the restart benchmark from #590.

Changes

  • LexicalGraphIndex.extract() and extract_and_build() declare run_id and run_plan_store (both default None), document them, including the ValueError with auto_tune=True, and pass them to the extraction pipeline only. Before this they also reached BuildPipeline.create, which does not use them.
  • indexing.mdx adds "What a restart costs" to the restart section: per-restart time at 100, 500 and 1,000 documents, the configuration behind each figure, and what the figures leave out.
  • Four unit tests, two per method: the parameters reach the extraction pipeline and not the build pipeline, and both are None when not passed.

No feature flag gates restart, so nothing was removed. I searched lexical-graph/src, docs-site, the examples and every env.template and README for one.

Problem

Restart shipped in 3.20, but its parameters were undocumented on the method a caller uses, and there was no published number for what a restart costs.

Related issue (if any): #

Testing

  • Unit tests added/updated
  • Integration tests added (as appropriate)
  • Existing tests pass (pytest)
  • Tested manually (describe below)

tests/unit/test_lexical_graph_index.py and tests/unit/indexing/extract: 411 passed. With lexical_graph_index.py reverted, the new tests fail. The docs page was not built locally.

Checklist

  • Code follows existing style and conventions
  • License headers present on new files
  • Documentation updated (if applicable)
  • No breaking changes (or clearly documented)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…publish what a restart costs

extract() took run_id and run_plan_store only through **kwargs, so they
were missing from its signature, its docstring and help(), and they also
reached BuildPipeline.create, which has no use for them. They are now
named parameters, documented, and passed to the extraction pipeline only.

indexing.mdx gains the measured cost of a restart at 100, 500 and 1,000
documents, with the configuration behind each figure and what the
figures leave out.
@noel-improv
noel-improv marked this pull request as ready for review November 5, 2026 22:19
@noel-improv noel-improv self-assigned this Nov 5, 2026
… handler

The two runs took 8h 43m and 3h 11m, so the 8m 5s of restarts is 1.5% and
4.2% of them. The figures come from interrupting inside staging, which waits
for uploads in flight, so they are slightly optimistic against a killed
process. run_id alone does not skip staged documents; the handler has to be
the run plan store's staging handler too.

@oussamahansal oussamahansal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. few nits:

…ild() and say auto_tune refuses a run_id

extract_and_build() took run_id and run_plan_store only through **kwargs,
so they reached BuildPipeline.create as well as the extraction pipeline.
The build side passes its kwargs to each transform and nothing there reads
either name, so dropping them from the build call changes nothing. They are
now named parameters passed to the extraction pipeline only, as on
extract().

The extract_and_build() docstring leaves out the staging handler: its
handler runs after the build, so there is nothing staged to skip, and a
restart there reuses the recorded batch jobs.

Both docstrings now say that a run_id with auto_tune=True raises a
ValueError, in the docs page's wording, since ExtractionPipeline raises it
for either entry point.
@noel-improv
noel-improv merged commit a4cc465 into awslabs:main Nov 10, 2026
9 checks passed
@noel-improv
noel-improv deleted the docs/restart-api-timings branch November 10, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants